#!/usr/bin/env python
# -*- coding: utf8 -*-
import ftplib
import re

def Getlist(arg=''):
#def Getlist(arg):
    liste.append(arg)
    # list.append[arg]

def getfich():
    liste = []
    global liste
    # Nouveau
    fich = []
    connection = ftplib.FTP('ftpperso.free.fr','mathieu.mordant','XXXXXXXXXXXXXXXXXXXXXXXX')
    regex = re.compile(r"index")
    liste = connection.retrlines('LIST',Getlist())
    #liste = connection.retrlines('LIST',GetList())
    n = 0
    for i in range(len(a.list)-1):
        buff = regex.search(a.list[i])
        if buff != None:
            fich.append(buff)
            n = n+1
    print n
    
getfich()